﻿using System.Web;
using System.Web.SessionState;

namespace BackEnd
{
	/// <summary>
	/// Summary description for ImageHandler
	/// </summary>
	public class ImageHandler : IHttpHandler, IRequiresSessionState
	{

		public void ProcessRequest(HttpContext context)
		{
			byte[] buffer = null;
			if (context.Session[GeneralResource.keyBufferImg] != null)
			{
				buffer = context.Session[GeneralResource.keyBufferImg] as byte[];

				if (buffer != null) 
					context.Response.BinaryWrite(buffer);
				context.Response.Expires = 0;
			}
		}


		public bool IsReusable
		{
			get
			{
				return false;
			}
		}
	}
}